import Vue from 'vue'
import App from './App.vue'
import router from './router'
import Element from '@plugins/element.js'
import Echart from '@plugins/echart.js'
import '@assets/css/style.css'
import 'font-awesome/css/font-awesome.min.css'
import axios from 'axios'
import store from './store'
// 导入进度条
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'

//过滤器
import filters from '@plugins/filter.js'
Object.keys(filters).forEach(key => {
    Vue.prototype["$" + key] = filters[key];
})
// 进度条显示
router.beforeEach((to, from, next) => {
  NProgress.start()
  next()
})
// 进度条关闭
router.afterEach(() => {
  NProgress.done()
})
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1'

// 拦截器
axios.interceptors.request.use(config => {
  config.headers.Authorization = window.sessionStorage.getItem('token')
  return config
})

Vue.prototype.$http = axios
Vue.prototype.imageurl = 'http://47.97.174.200:10444/Api'
Vue.config.productionTip = false


new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
